package com.jin.webvideo.config;

import com.jin.webvideo.service.RefreshService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * 初始化
 * @author biao532
 * @date 2023/12/04 19:53
 **/
@Component
public class InitApplicationListener implements ApplicationListener<ApplicationStartedEvent> {
    private static final Logger LOGGER = LoggerFactory.getLogger(InitApplicationListener.class);
    @Autowired
    private RefreshService service;
    @Override
    public void onApplicationEvent(ApplicationStartedEvent event) {
        LOGGER.info("refresh accessControl {}", service.accessControl());
    }
}
